package com.gzh.teaching.model.vo;

import com.gzh.core.util.NumericHelper;
import com.gzh.teaching.service.dto.AddCourseIn;
import lombok.Getter;
import lombok.NonNull;
import lombok.Setter;
import lombok.ToString;

import javax.validation.constraints.NotNull;

@Setter
@Getter
@ToString
public class AddCourseParam {
  //名称
  @NotNull(message = "课程名不能为空")
  private String courseName;
  //课程类型
  private String courseType;
  //id
  private String fileId;

  private String credit;

  public AddCourseIn paramToIn(Integer userId) {
    AddCourseIn in = new AddCourseIn();
    in.setCourseName(this.courseName);
    in.setFileId(NumericHelper.toInteger(this.fileId));
    in.setCourseType(NumericHelper.toInteger(this.courseType));
    in.setCredit(NumericHelper.toInteger(this.credit));
    in.setUserId(userId);
    return in;
  }
}
